package com.tedu.egmvc2.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class EmpController {
    @RequestMapping("/emp/add")
    @ResponseBody
    public String add(String name,Double salary,String job){
        System.out.println("添加----姓名:"+name+",薪资:"+salary+",工作:"+job);
        return "添加成功！姓名:"+name+",薪资:"+salary+",工作:"+job;
    }

    @RequestMapping("/emp/list")
    @ResponseBody
    public String list(){
        return "查询成功！";
    }

    @RequestMapping("/emp/update")
    @ResponseBody
    public String update(String name,Double salary,String job){
        System.out.println("修改----姓名:"+name+",薪资:"+salary+",工作:"+job);
        return "修改成功！姓名:"+name+",薪资:"+salary+",工作:"+job;
    }

    @RequestMapping("/emp/delete")
    @ResponseBody
    public String delete(String id){
        System.out.println("id:"+id);
        return "删除成功！id:"+id;
    }
}
